﻿using System;
using System.Collections.Generic;
using System.Threading;
using System.Windows.Forms;

namespace HangameAuto02
{
    static class Program
    {
        /// <summary>
        /// The main entry point for the application.
        /// </summary>
        [STAThread]
        static void Main()
        {
            try
            {
                Application.ThreadException += Application_ThreadException;
                AppDomain.CurrentDomain.UnhandledException += UnhandleExceptionHandler;

                Application.EnableVisualStyles();
                Application.SetCompatibleTextRenderingDefault(false);
                Application.Run(new Login());
            }
            catch (Exception)
            {
                GlobalErrorShowMessage();
            }
           
        }

        static void Application_ThreadException(object sender, ThreadExceptionEventArgs e)
        {
            GlobalErrorShowMessage();
        }

        static void UnhandleExceptionHandler(object sender, UnhandledExceptionEventArgs args)
        {
            GlobalErrorShowMessage();
        }

        static void GlobalErrorShowMessage()
        {
            MessageBox.Show(string.Format("오류가 발생했습니다. 해당 게임이 실행중인지 확인해주십시오."));
        }

    }
}
